package com.esri.core.internal.tasks.oauth;

import java.io.IOException;
import org.codehaus.jackson.JsonParseException;
import org.codehaus.jackson.JsonParser;
import org.codehaus.jackson.JsonToken;

/* loaded from: classes.dex */
public class e {
    private String a;
    private String b;
    private String c;
    private String d;
    private int e;
    private String f;
    private boolean g;

    public e(String str, String str2, String str3, int i) {
        this(str, str2, str3, null, i);
    }

    public e(String str, String str2, String str3, String str4, int i) {
        this.a = str;
        this.b = str2;
        this.c = str3;
        this.d = str4;
        this.e = i;
    }

    public e(JsonParser jsonParser) {
        try {
            if (com.esri.core.internal.util.d.c(jsonParser)) {
                while (jsonParser.nextToken() != JsonToken.END_OBJECT) {
                    String currentName = jsonParser.getCurrentName();
                    if ("device".equals(currentName)) {
                        a(jsonParser);
                    } else {
                        jsonParser.nextToken();
                        if (!"deviceToken".equals(currentName)) {
                            if ("access_token".equals(currentName)) {
                                this.a = jsonParser.getText();
                            } else if ("token_type".equals(currentName)) {
                                this.b = jsonParser.getText();
                            } else if ("expires_in".equals(currentName)) {
                                this.e = jsonParser.getIntValue();
                            } else if ("refresh_token".equals(currentName)) {
                                this.c = jsonParser.getText();
                            } else if ("username".equals(currentName)) {
                                this.f = jsonParser.getText();
                            } else if ("ssl".equals(currentName)) {
                                this.g = jsonParser.getBooleanValue();
                            } else {
                                jsonParser.skipChildren();
                            }
                        }
                    }
                }
            }
        } catch (JsonParseException e) {
            e.printStackTrace();
        } catch (IOException e2) {
            e2.printStackTrace();
        } catch (Exception e3) {
            e3.printStackTrace();
        }
    }

    private void a(JsonParser jsonParser) throws IOException {
        while (jsonParser.nextToken() != JsonToken.END_OBJECT) {
            if ("deviceId".equals(jsonParser.getCurrentName())) {
                this.d = jsonParser.getText();
            }
        }
    }

    public String a() {
        return this.a;
    }

    public String b() {
        return this.d;
    }

    public String c() {
        return this.b;
    }

    public int d() {
        return this.e;
    }

    public String e() {
        return this.c;
    }

    public String f() {
        return this.f;
    }

    public boolean g() {
        return this.g;
    }
}
